﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SAFP
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
            this.Hide();
            (new LoginForm()).ShowDialog();
            //            MessageBox.Show("Elvileg bezárult most.");
//            if (Program.UserID == 0)
//                Program.OfflineMode = true; //Felesleges, lehet elleőrizni a UserID-val is
            /*          //Teszt:
                        if (Program.OfflineMode)
                            MessageBox.Show("Offline");
                        else
                            MessageBox.Show("Online");
                    }*/
            if (Program.UserID == 0)
                offlineToolStripMenuItem.Text = "Go online";
            else
                offlineToolStripMenuItem.Text = "Go offline"; //Azért adom meg itt is a szöveget, hogy majd a nyelveknél itt be lehessen állitani.
        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void offlineToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Program.UserID == 0)
            {
                this.Hide();
                (new LoginForm()).ShowDialog();
                this.Show();
            }
            else
                Program.UserID = 0;

            if (Program.UserID == 0)
                offlineToolStripMenuItem.Text = "Go online";
            else
                offlineToolStripMenuItem.Text = "Go offline";
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("http://safp.tk/");
        }
    }
}
